package mysql

import "gorm.io/gorm"

type RealName struct {
	gorm.Model
	UserId int    `gorm:"type:int(11);not null;index:ip_idx"`
	IdCard string `gorm:"type:varchar(18);not null;"`
	Name   string `gorm:"type:varchar(20);not null;"`
}

func (r *RealName) CheckoutRealName(UserId int, IdCard string) error {

	return DB.Debug().Where("user_id  = ? or id_card = ?", UserId, IdCard).Limit(1).Find(&r).Error

}
func (r *RealName) Create() error {

	return DB.Debug().Model(&r).Create(&r).Error

}
